}
}
+ /// Return the host triple for this context
+ pub fn host_triple(&self) -> &str {
+ &self.config.rustc_info().host[..]
+ }
+
/// Return the target triple which this context is targeting.
pub fn target_triple(&self) -> &str {
&self.target_triple
}
+ /// Requested (not actual) target for the build
+ pub fn requested_target(&self) -> Option<&str> {
+ self.build_config.requested_target.as_ref().map(|s| &s[..])
+ }
+
/// Get the metadata for a target in a specific profile
pub fn target_metadata(&self, unit: &Unit) -> Option<Metadata> {
let metadata = unit.target.metadata();
None => return true,
};
let (name, info) = match kind {
- Kind::Host => (&self.config.rustc_info().host, &self.host_info),
- Kind::Target => (&self.target_triple, &self.target_info),
+ Kind::Host => (self.host_triple(), &self.host_info),
+ Kind::Target => (self.target_triple(), &self.target_info),
};
platform.matches(name, info.cfg.as_ref().map(|cfg| &cfg[..]))
}
/// Number of jobs specified for this build
pub fn jobs(&self) -> u32 { self.build_config.jobs }
- /// Requested (not actual) target for the build
- pub fn requested_target(&self) -> Option<&str> {
- self.build_config.requested_target.as_ref().map(|s| &s[..])
- }
-
pub fn lib_profile(&self, _pkg: &PackageId) -> &'a Profile {
let (normal, test) = if self.build_config.release {
(&self.profiles.release, &self.profiles.bench_deps)
.env("CARGO_MANIFEST_DIR", unit.pkg.root())
.env("NUM_JOBS", &cx.jobs().to_string())
.env("TARGET", &match unit.kind {
- Kind::Host => &cx.config.rustc_info().host[..],
+ Kind::Host => cx.host_triple(),
Kind::Target => cx.target_triple(),
})
.env("DEBUG", &profile.debuginfo.to_string())
.env("OPT_LEVEL", &profile.opt_level.to_string())
.env("PROFILE", if cx.build_config.release {"release"} else {"debug"})
- .env("HOST", &cx.config.rustc_info().host)
+ .env("HOST", cx.host_triple())
.env("RUSTC", &cx.config.rustc())
.env("RUSTDOC", &cx.config.rustdoc());